home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
dskut
/
comt010d.zip
/
COMTSRC.ZIP
/
OBF.ASM
< prev
next >
Wrap
Assembly Source File
|
1991-12-26
|
3KB
|
173 lines
.model tiny
.code
org 100h
Start:
; Comment out for error checking
smov macro x,y
push y
pop x
endm
LineFeed macro
cmp ax,0a0dh
endm
Zeta0 = 6d72h
Zeta = 6e71h
Zeta2 = 4b60h
Off100:
db 'ENC.COM.'
db 'ABC' ; this says how far it is to the end from after the 'C'
LineFeed
and ax,3030h
and ax,4040h ; set ax=0
smov dx,ax ; set dx=0
sub ax,Zeta0
sub ax,Zeta0
sub ax,-(offset Jmp2)-Zeta0-Zeta0
smov di,ax
smov si,dx
dec si
xor [di],si
; sub al,Jmp2-Jmp1
; smov di,ax
; smov si,dx
; and [di],si
;; Want SI=00EB (jmp $+2)
; smov ax,dx
; sub al,70h
; xor al,0ebh xor -70h
; smov si,ax
; xor [di],si
smov ax,dx
sub ax,Zeta
sub ax,Zeta
push ax
sub ax,-(offset udata)-Zeta-Zeta ; adjust later so ax=udata
smov cx,ax
sub ax,7021h
sub ax,6021h
sub ax,63h-(7021h+6021h) ; ax-=0063h
smov bp,ax
LineFeed
pop ax
sub ax,-(offset DirectPoke)-Zeta-Zeta ; adjust so ax=DirectPoke
smov di,ax
push di
smov si,dx ; si=0
and [di],si
inc di
inc di
and [di],si
inc di
inc di
and [di],si
inc di
inc di
and [di],si
inc di
inc di
and [di],si
pop di ; direct poke area is zero
; want si=E4D0
smov ax,dx ; ax=0
sub ax,Zeta2 ; ax=D1D1
xor ax,(-Zeta2) xor 0e4d0h ; ax=e4d0
smov si,ax
xor [di],si
inc di
inc di
xor [di],si
inc di
inc di
xor [di],si
inc di
inc di
xor [di],si
inc di
inc di
; now want si=e008 ; ax=e4d0
sub ax,217eh
xor ax,0e008h xor (0e4d0h-217eh) ; ax=e008
smov si,ax
xor [di],si
smov di,cx
jz FlushPref
jnz FlushPref
db 13,10,'COMT_is_copyright_Alex_Pruss.',13,10
FlushPref:
Top:
smov ax,dx
xor ax,[bp+063h]
inc bp
inc bp
; push ax
; sub al,'Z'
; pop ax
cmp al,'Z'
jz DoneJ
; push ax
; sub ax,0a0dh
; pop ax
cmp ax,0a0dh
jz HandleNewLine
sub ax,'AA' ; OK, now want AL+=AH>>4
DirectPoke: db 0dh,0ah,'Good-d' ; shr ah,1 four times--D0E4
db 'ay' ; add al,ah--08E0
; al=right value
smov si,dx
and [di],si ; set to 0
smov si,ax
xor [di],si ; set to al
inc di
Pos:
db 75h ; jnz (NZ IS set)
Jmp2:
db not (Top-Pos-2) ; just negate this
db 'Hi,Howdy??'
HandleNewLine:
inc dx
dec dx
J0:
db 74h ; jz (of course Z as DX=0 permanently)
Enc macro Val
db 'A'+((Val) and 0fh)
db 'A'+(((Val) shr 4) and 0fh)
endm
udata:
Enc (Top-(J0+2))
DoneJ=$-1
;
; Enc 0C3h ; ret
; db 'Z'
;
; db 'ILAAME' ; B8 00 4C (mov ax,4c)
; db 'NM','BC' ; int 21h
; db 'Z'
;
;0123456789ABCDEF
;ABCDEFGHIJKLMNOP
end Start